<template>
	<view class="body">
		<view class="title-box" @click="back()">
			<!-- <view class="title">荷式拍卖列表</view> -->
			<text class="iconfont icon-left"></text>
		</view>
		<view class="item">
			<view class="title" style="display: flex;">
				入驻原因<span style="color: #D70000; display: block;">*</span>
			</view>
			<view class="in-ys">
				<input style="border: 0px;" :disabled="dis" placeholder="请输入入驻原因" border="none" v-model="user.reason" />
			</view>
		</view>
		<view class="item">
			<view class="title" style="display: flex;">
				入驻状态<span style="color: #D70000; display: block;">*</span>
			</view>
			<view class="in-ys">
				<view class="status" style="color: black;" v-if="user.status==0">暂未入驻</view>
				<view class="status" style="color: #ffff00;" v-if="user.status==1">审核中</view>
				<view class="status" style="color: #00ff00;" v-if="user.status==2">审核成功</view>
				<view class="status" style="color: #ff0000;" v-if="user.status==3">审核拒绝</view>
			</view>
		</view>
		<view class="bottom">
			<view class="button" @click="submit" v-if="user.status == 0">提交</view>
			<view class="button" @click="xinxi" v-if="user.status != 0">完善入驻信息</view>
			<view class="button" @click="back">返回</view>
		</view>
	</view>
</template>

<script>
	import apis from '@/api/index.js'
	import {
		requestApi,uphttp
	} from '@/utils/request.js'
	// 导入公共组件方法
	import common from '@/common/js/common.js';
	export default {
		data() {
			return {
				user: {
					reason:'',
					dis:false,
				},
			}
		},
		onLoad() {
		this.user = uni.getStorageSync("user")	
		if(this.user.status !=0){
			this.dis = true;
		}
		},
		methods: {
			submit() {
				this.user.status = 1;
				requestApi(apis.user.apply, this.user, 'post').then(res => {
					if (res.code == 200) {
						uni.showToast({
							icon: "none",
							title: "提交成功"
						})
						uni.setStorageSync("user",this.user);
					}
				})
			},
			xinxi(){
			uni.navigateTo({
				url:"/pages/center/xinxi",
			})	
			},
			back() {
				uni.navigateBack({
					delta: 1
				})
			}

		}
	}
</script>

<style>
	.body {
		padding: 0 32rpx;
		min-height: 100vh;
		background-image: url('../../static/bgc.png');
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}

	.item {
		display: flex;
		padding: 24rpx;
		padding-top: 50rpx;
		align-items: center;
		position: relative;
		/* justify-content: space-between; */
		border-bottom: 1px solid #fafafa;
	}

	.block {
		width: 100%;
		height: auto;
		border-bottom: 24rpx solid #F1F6FB;
		padding: 0 32rpx 32rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
	}

	.title {
		width: 160rpx;
		margin-right: 30rpx;
		font-family: 'PingFang SC';
		font-style: normal;
		font-weight: 400;
		font-size: 28rpx;
		line-height: 40rpx;
		color: rgba(51, 51, 51, 0.4);
		text-align: left;
	}

	.button {

		width: 40%;

		color: #fff;
		background-color: #07b1ff;
		padding: 32rpx;
		border-radius: 64rpx;
		text-align: center;
	}

	.bottom {
		position: absolute;
		bottom: 40rpx;
		left: 50%;
		transform: translateX(-50%);
		width: 100%;
		display: flex;
		justify-content: space-between;
	}
</style>